<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>background-size</title>
    <style>
        .box1 {
            width: 500px;
            height: 300px;
            border: 1px solid #000;
            background-image: url(../images/archer.png);
            background-size: 300px auto;
            margin-bottom: 10px;
        }

        .box2 {
            width: 500px;
            height: 300px;
            border: 1px solid #000;
            background-image: url(../images/archer.png);
            background-size: 25% auto;
            margin-bottom: 10px;
        }

        .box3 {
            width: 500px;
            height: 300px;
            border: 1px solid #000;
            background-image: url(../images/bg2.png);
            background-size: contain;
            background-repeat: no-repeat;

            margin-bottom: 10px;
        }

        .box4 {
            width: 500px;
            height: 300px;
            border: 1px solid #000;
            background-image: url(../images/bg2.png);
            background-size: cover;
            background-repeat: no-repeat;
            margin-bottom: 10px;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>


</body>

</html>